package de.wwi11b2.mjp.comicvineclient;

import java.io.Serializable;

public class Item implements Serializable {

	private static final long serialVersionUID = 1L;
	private String name;
	private String description;
	private byte[] image;
	private ResourceType resourceType;

	public enum ResourceType {
		CHARACTER, LOCATION;

		public static ResourceType getType(int i) {
			switch (i) {
			case 0:
				return CHARACTER;
			case 1:
				return LOCATION;
			}
			return null;
		}
	}

	public Item(String name, String description, ResourceType resourceTyp,
			byte[] image) {
		setName(name);
		setDescription(description);
		setImage(image);
		setResource(resourceTyp);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public byte[] getImage() {
		return image;
	}

	public void setImage(byte[] imageView) {
		this.image = imageView;
	}

	public ResourceType getResource() {
		return resourceType;
	}

	public void setResource(ResourceType resource) {
		this.resourceType = resource;
	}

    @Override
    public String toString() {
        return getName();
    }
}